//
//  AccessoryHubHelper.m
//  CedarSuperCloud
//
//  Created by lshenrong on 2017/11/24.
//  Copyright © 2017年 cedarhd. All rights reserved.
//

#import "AccessoryHubHelper.h"
#import "MBProgressHUD.h"

@interface AccessoryHubHelper ()

@property (nonatomic, weak) UIView *inView;

@end

@implementation AccessoryHubHelper


+ (instancetype)makeAnOverlayerInstanceInView:(UIView *)view{
    AccessoryHubHelper *accessory = [[AccessoryHubHelper alloc] init];
    accessory.inView = view;
    return accessory;
}

- (void)requestWillStart:(id)request{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.inView animated:YES];
    hud.mode = MBProgressHUDModeIndeterminate;
    CGPoint point = hud.offset;
    point.y-=20;
    hud.offset = point;
    hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
    hud.bezelView.color = [[UIColor blackColor]colorWithAlphaComponent:0.6f];
    hud.contentColor = [UIColor whiteColor];
}

- (void)requestDidStop:(id)request{
   [MBProgressHUD hideHUDForView:self.inView animated:YES];
}

@end
